package com.elitel.frame.web.acservicefilterfield.service.impl;

import com.elitel.frame.web.acservicefilterfield.dao.AcServiceFilterFieldsDao;
import com.elitel.frame.web.acservicefilterfield.entity.AcServiceFilterFields;
import com.elitel.frame.web.acservicefilterfield.service.AcServiceFilterFieldsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 访问控制-服务过滤字段(AcServiceFilterField)表服务实现类
 *
 * @author makejava
 * @since 2025-05-19 17:15:42
 */
@Service
public class AcServiceFilterFieldsServiceImpl implements AcServiceFilterFieldsService {
    @Resource
    private AcServiceFilterFieldsDao acServiceFilterFieldDao;

    /**
     * 通过ID查询单条数据
     *
     * @param filterFieldId 主键
     * @return 实例对象
     */
    @Override
    public AcServiceFilterFields queryById(String filterFieldId) {
        return this.acServiceFilterFieldDao.queryById(filterFieldId);
    }


    /**
     * 新增数据
     *
     * @param acServiceFilterFields 实例对象
     * @return 实例对象
     */
    @Override
    public AcServiceFilterFields insert(AcServiceFilterFields acServiceFilterFields) {
        this.acServiceFilterFieldDao.insert(acServiceFilterFields);
        return acServiceFilterFields;
    }

    /**
     * 修改数据
     *
     * @param acServiceFilterFields 实例对象
     * @return 实例对象
     */
    @Override
    public AcServiceFilterFields update(AcServiceFilterFields acServiceFilterFields) {
        this.acServiceFilterFieldDao.update(acServiceFilterFields);
        return this.queryById(acServiceFilterFields.getFilterFieldId());
    }

    /**
     * 通过主键删除数据
     *
     * @param filterFieldId 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(String filterFieldId) {
        return this.acServiceFilterFieldDao.deleteById(filterFieldId) > 0;
    }
}
